<?php
/**
 * 描述：行业展会-主页。
 * @final
 */
final class Exec_Exhibition_Index extends Exec
{
    public function Get()
    {
        #获取数据-特别推荐
        $data=DB::GetRows('select * from exhibition_infos where M_IsRecommend=TRUE order by M_IsRecommend_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$data['ThumbnailPath'];
        }
        View::Assign('Exhibition_Index_SpecialRecommend',$data);

        #获取数据-合作展会
        $data=DB::GetRows('select * from exhibition_infos where M_IsCooperation=TRUE order by ID desc limit 0,2');
        View::Assign('Exhibition_Index_ExhibitionCooperation',$data);

        #获取数据-展会新闻
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::EXHIBITION_NEWS_ID.' and M_IsDelete=false order by ID desc limit 0,5');
        View::Assign('NewsClass_ExhibitionNews_ID',DAO_NewsClass::EXHIBITION_NEWS_ID);
        View::Assign('Exhibition_Index_ExhibitionNews_Topside',@$data[0]);
        View::Assign('Exhibition_Index_ExhibitionNews',array_slice($data,1,count($data)));


        #获取数据-国内展会
        $data=DB::GetRows('select * from exhibition_infos where ClassID='.DAO_ExhibitionClass::INLAND_ID.' order by ID desc limit 0,5');
        View::Assign('Exhibition_Index_Inland',$data);

        #获取数据-国际展会
        $data=DB::GetRows('select * from exhibition_infos where ClassID='.DAO_ExhibitionClass::INTERNATIONAL_ID.' order by ID desc limit 0,5');
        View::Assign('Exhibition_Index_International',$data);
        
        #获取数据-展会专题
        $data=DB::GetRows('select * from exhibition_topic order by ID desc');
        foreach($data as &$row)
        {
            $row['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$row['ThumbnailPath'];
        }
        View::Assign('Exhibition_Index_ExhibitionTopic',$data);

        #获取数据-参展回顾
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::EXHIBITION_REVIEW_ID.' and M_IsDelete=FALSE order by ID desc limit 0,6');
        View::Assign('NewsClass_ExhibitionReview_ID',DAO_NewsClass::EXHIBITION_REVIEW_ID);
        View::Assign('Exhibition_Index_News_ExhibitionReview',$data);

        #获取数据-会展公司
        $data=DB::GetRows('select * from exhibition_company order by ID desc limit 0,4');
        foreach($data as &$row)
        {
            $row['Logo']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$row['Logo'];
        }
        View::Assign('Exhibition_Index_ExhibitionCompany',$data);
        
        #获取数据-展会指南
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::EXHIBITION_GUIDE_ID.' and M_IsDelete=FALSE order by ID desc limit 0,10');
        View::Assign('Exhibition_Index_News_ExhibitionGuide',$data);

        #渲染输出
        View::Display('exhibition/index.tpl');
    }
}
?>